<HTML><HEAD><TITLE>heap_to_list(+Heap, -List)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(heaps)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>heap_to_list(+Heap, -List)</H1>
returns the current set of Key-Datum pairs in the Heap as a List.
<H2>Description</H2>

    returns the current set of Key-Datum pairs in the Heap as a
    List, sorted into ascending order of Keys.  This is included
    simply because I think every data structure foo ought to have
    a foo_to_list and list_to_foo relation (where, of course, it
    makes sense!) so that conversion between arbitrary data
    structures is as easy as possible.  This predicate is basically
    just a merge sort, where we can exploit the fact that the tops
    of the subtrees are smaller than their descendants.
    

</BODY></HTML>
